<template>
  <div>
    <div class="coupon_top">
      <img src="../../assets/img/coupon_bj.jpg" alt />
    </div>
    <div class="coupon_banner">
      <div>
        <img src="../../assets/img/coupon_mj.png" alt />
        <div class="yhq_img">
            <img src="../../assets/img/yhq_zxdj.png" alt="">
            <img src="../../assets/img/yhq_lqzs.png" alt="">
            <img src="../../assets/img/yhqxpsx.png" alt="">
        </div>
      </div>
    </div>
    <div class="coupon_body">
        <div style="width:1200px;">
              <CouponItem v-if='couponList.length !== 0' :data="couponList"></CouponItem>
              <img class="zwyhImg" v-else src="../../assets/img/wyhqpng.png" alt="">
        </div>
    </div>
  </div>
</template>

<script>
import { mapMutations } from "vuex";
import { getcouponList , receivecoupon } from "../../api/goods";
import CouponItem from '@/components/coupon-item'
export default {
    components:{
        CouponItem
    },
  data() {
    return {
      couponList: []
    };
  },
  mounted() {
    this.setHasNav(false);
  },
  created() {
    this.getCoupon();
  },
  methods: {
    ...mapMutations({
      setHasNav: "app/SET_PAGE_HAS_NAV"
    }),
    async getCoupon() {
      const res = await getcouponList();
      this.couponList = res;
      console.log(this.couponList);
    },
  }
};
</script>

<style lang="scss">
.coupon_banner {
  width: 100%;
  height: 256px;
  background: #fff;
  display: flex;
  justify-content: center;
  >div {
    width: 1200px;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
  }
}
.coupon_body {
  width: 100%;
  min-height: 500px;
  background: #84e7ff;
  display: flex;
  justify-content: center;
 
}
.yhq_img{
    >img{
        transition: all 0.5s;
        &:hover{
            transform: translateY(20px);
        }
    }
}
.zwyhImg{
  display: block;
  margin: 0 auto;
}
</style>
